<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
// use Illuminate\Support\Facades\Schema;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateDingdingTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('sf_dingding', function (Blueprint $table) {
            $table->comment = '钉钉自定义机器人配置表';
            $table->bigIncrements('id');
            $table->string('url', 255)->comment('钉钉webhookurl')->default('');
            $table->string('secret', 255)->comment('钉钉webhook的秘钥')->default('');
            $table->tinyInteger('type')->comment('类型1:UI2前端')->default(1);
            $table->tinyInteger('status')->comment('是否启用1:启用2不启用')->default(1);
            $table->text('click_url')->comment('钉钉推送的跳转链接');
            $table->bigInteger('created_time')->comment('创建时间')->default(0);
            $table->bigInteger('updated_time')->comment('修改时间')->default(0);

            $table->index('type');
            $table->index('status');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('sf_dingding');
    }
}
